package Day;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Day4 {
    public static void main1(String[] args) {
        int []arr={1,23,4,2,31,3,45,2,1};
        System.out.println(maxLength(arr));


    }


    public static int maxLength (int[] arr) {
      int max=1;
      int start=0;
      int []dp=new int[100000];
        for (int i = 0; i < arr.length ; i++) {
            if(dp[arr[i]]==0){
                dp[arr[i]]++;
                max=Math.max(max,i-start+1);
            }else {
                while(dp[arr[i]]!=0){
                    dp[arr[start]]--;
                    start++;
                }
                dp[arr[i]]++;
            }
        }
        return max;
    }

    public static int maxLength1 (int[] arr) {
        Map<Integer,Integer> hash=new HashMap<>();
        int max=-1;
        int start=0;
        for (int i = 0; i < arr.length ; i++) {
         if(!hash.containsKey(arr[i])){
             hash.put(arr[i],1 );
             max=Math.max(max,i-start+1);
         }else {
             while(hash.containsKey(arr[i])){
                 hash.remove(arr[start]);
                 start++;
             }
             hash.put(arr[i],1);
         }
        }
        return max;
    }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        String s=in.next();
        int []arr=new int[26];
char []ch=s.toCharArray();
        for (int i = 0; i <ch.length ; i++) {

        }


    }

    class t implements Comparable<t>{
        char ch;
        int n;
        @Override
        public int compareTo(t o) {
            return this.n-o.n;
        }

        public t(char ch, int n) {
            this.ch = ch;
            this.n = n;
        }
    }






}
